/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package models;

import java.util.Date;
import javax.persistence.*;
import play.data.validation.*;
import play.db.jpa.Model;

/**
 *
 * @author GJean
 */
@Entity
@Table(name = "employees")
public class Employee extends Model {

    @Required
    public Date hiredate;
    @Required
    public Date firedate;
    @Required
    public Double salary;
    @Required
    public Double hours;
    @Required
    public String picture;
    @Required
    @OneToOne
    public User user;

    public Employee(Date hiredate, Date firedate, Double salary, Double hours, String picture, User user) {

        this.hiredate = hiredate;
        this.firedate = firedate;
        this.salary = salary;
        this.hours = hours;
        this.picture = picture;
        this.user = user;


    }

    @Override
    public String toString() {
        return this.user.firstname + " " + this.user.lastname;
    }
}
